<?php

class Cat_Common
{
	public static function withDefaults( array $data, array $defaults )
	{
		foreach( $defaults as $key => $val )
		{
			if ( !isset( $data[$key] ) )
			{
				$data[$key] = $val;
			}
		}
		
		return $data;
	}
	
	public static function checkArgs( array $args, array $schema )
	{
		foreach( $schema as $key => $type )
		{						
			Cat_Assert::assertType( $args[$key], $type );
		}
	}
}

?>